package com.chenfeng.wiki.controller;

import com.chenfeng.wiki.domain.Demo;
import com.chenfeng.wiki.domain.Ebook;
import com.chenfeng.wiki.mapper.EbookMapper;
import com.chenfeng.wiki.req.EbookReq;
import com.chenfeng.wiki.resp.CommonResp;
import com.chenfeng.wiki.resp.EbookResp;
import com.chenfeng.wiki.service.DemoService;
import com.chenfeng.wiki.service.EbookService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.awt.print.Book;
import java.util.List;



@RestController
@RequestMapping("/ebook")
public class Ebookcontroller {

    @Resource
    private EbookService ebookService;
    @GetMapping("/list")
    public CommonResp list(EbookReq req){
        CommonResp<List<EbookResp>> resp = new CommonResp();
        List<EbookResp> list = ebookService.list(req);
        resp.setContent(list);
        return resp;
    }
}
